home *** CD-ROM | disk | FTP | other *** search
/ Champak 106 / Vol 106.iso / games / honey_be.swf / scripts / frame_10 / DoAction.as
Text File  |  2010-04-12  |  23KB  |  932 lines

  1. MovieClip.prototype.popempty = function()
  2. {
  3.    r.stat.attachMovie("emptycan","emptycan",r.nbd + 100,{_x:345,_y:160});
  4. };
  5. MovieClip.prototype.initwatermeter = function()
  6. {
  7.    var t = this;
  8.    t._alpha = 0;
  9.    t.onEnterFrame = function()
  10.    {
  11.       if(t._parent.zone.hitTest(r._xmouse,r._ymouse,1) or r.act == "pumping" or r.act == "watering")
  12.       {
  13.          t._alpha = Math.min(100,t._alpha + 10);
  14.       }
  15.       else
  16.       {
  17.          t._alpha = Math.max(0,t._alpha - 10);
  18.       }
  19.       t.bar._yscale = r.watercontent / r.watercontentmax * 100;
  20.    };
  21.    stop();
  22. };
  23. MovieClip.prototype.initmap = function()
  24. {
  25.    if(r.totalfence < 2 && r.totalbeeskep.length < 3)
  26.    {
  27.       var _loc10_ = 10;
  28.    }
  29.    else
  30.    {
  31.       _loc10_ = 0;
  32.    }
  33.    var _loc11_ = 0;
  34.    var _loc3_ = 400;
  35.    var _loc1_ = 10;
  36.    var _loc14_ = 0;
  37.    var _loc6_ = 125;
  38.    var _loc2_ = _loc11_ + 100 + _loc10_;
  39.    var _loc5_ = 1;
  40.    while(_loc5_ <= r.totalfence)
  41.    {
  42.       m.attachMovie("fence" + _loc5_,"fence" + _loc5_,_loc1_,{_x:_loc2_,_y:_loc3_});
  43.       m.place.attachMovie("soil","soil" + _loc5_,_loc1_,{_x:_loc2_,_y:_loc3_});
  44.       _loc2_ += _loc6_;
  45.       _loc1_ = _loc1_ + 1;
  46.       _loc5_ = _loc5_ + 1;
  47.    }
  48.    _loc2_ += _loc10_;
  49.    m.attachMovie("pump","pump",_loc1_,{_x:_loc2_,_y:_loc3_ + 3});
  50.    _loc1_ = _loc1_ + 1;
  51.    _loc2_ += 22;
  52.    m.attachMovie("watercan" + r.watercansize,"watercan",_loc1_,{_x:_loc2_,_y:_loc3_ - 22});
  53.    _loc1_ = _loc1_ + 1;
  54.    _loc2_ += 65 + _loc10_;
  55.    m.attachMovie("roundtable","roundtable",_loc1_,{_x:_loc2_,_y:_loc3_ + 3});
  56.    _loc1_ = _loc1_ + 1;
  57.    if(r.honeytype.length == 3)
  58.    {
  59.       pos = [{xx:_loc2_ - 16,yy:_loc3_ - 62},{xx:_loc2_,yy:_loc3_ - 59.5},{xx:_loc2_ + 16,yy:_loc3_ - 62}];
  60.    }
  61.    else if(r.honeytype.length == 2)
  62.    {
  63.       pos = [{xx:_loc2_ - 10,yy:_loc3_ - 60},{xx:_loc2_ + 10,yy:_loc3_ - 60}];
  64.    }
  65.    else
  66.    {
  67.       pos = [{xx:_loc2_,yy:_loc3_ - 60}];
  68.    }
  69.    _loc5_ = 0;
  70.    while(_loc5_ < r.honeytype.length)
  71.    {
  72.       m.attachMovie("pouch" + r.honeytype[_loc5_],"pouch" + r.honeytype[_loc5_],_loc1_,{_x:pos[_loc5_].xx,_y:pos[_loc5_].yy});
  73.       _loc1_ = _loc1_ + 1;
  74.       _loc5_ = _loc5_ + 1;
  75.    }
  76.    _loc2_ += 80;
  77.    var _loc4_ = 1;
  78.    _loc6_ = 85;
  79.    var _loc8_ = r.totalbeeskep.count(1);
  80.    var _loc9_ = r.totalbeeskep.count(2);
  81.    if(_loc8_)
  82.    {
  83.       _loc5_ = 0;
  84.       while(_loc5_ < _loc8_)
  85.       {
  86.          m.attachMovie("beeskep","beeskep" + _loc4_,_loc1_,{_x:_loc2_,_y:_loc3_,bsize:1});
  87.          _loc2_ += _loc6_;
  88.          _loc4_ = _loc4_ + 1;
  89.          _loc1_ = _loc1_ + 1;
  90.          _loc5_ = _loc5_ + 1;
  91.       }
  92.    }
  93.    _loc5_ = 0;
  94.    while(_loc5_ < _loc9_)
  95.    {
  96.       m.attachMovie("beeskep","beeskep" + _loc4_,_loc1_,{_x:_loc2_,_y:_loc3_,bsize:2});
  97.       _loc2_ += _loc6_;
  98.       _loc4_ = _loc4_ + 1;
  99.       _loc1_ = _loc1_ + 1;
  100.       _loc5_ = _loc5_ + 1;
  101.    }
  102.    _loc2_ += 60 + _loc10_;
  103.    m.attachMovie("tablebig","tablebig",_loc1_,{_x:_loc2_,_y:_loc3_});
  104.    _loc1_ = _loc1_ + 1;
  105.    if(r.honeytype.length == 1)
  106.    {
  107.       m.attachMovie("basket" + r.honeytype[0],"basket1",_loc1_,{_x:_loc2_ - 40,_y:_loc3_ - 70});
  108.       _loc1_ = _loc1_ + 1;
  109.       r.maxwid = _loc2_;
  110.    }
  111.    else if(r.honeytype.length == 2)
  112.    {
  113.       m.attachMovie("basket" + r.honeytype[0],"basket1",_loc1_,{_x:_loc2_ - 45,_y:_loc3_ - 70});
  114.       _loc1_ = _loc1_ + 1;
  115.       m.attachMovie("basket" + r.honeytype[1],"basket2",_loc1_,{_x:_loc2_ + 25,_y:_loc3_ - 70});
  116.       _loc1_ = _loc1_ + 1;
  117.       r.maxwid = _loc2_ + 100;
  118.    }
  119.    else
  120.    {
  121.       m.attachMovie("basket1","basket1",_loc1_,{_x:_loc2_ - 62,_y:_loc3_ - 70});
  122.       _loc1_ = _loc1_ + 1;
  123.       m.attachMovie("basket2","basket2",_loc1_,{_x:_loc2_,_y:_loc3_ - 70});
  124.       _loc1_ = _loc1_ + 1;
  125.       m.attachMovie("basket3","basket3",_loc1_,{_x:_loc2_ + 62,_y:_loc3_ - 70});
  126.       _loc1_ = _loc1_ + 1;
  127.       r.maxwid = _loc2_ + 160;
  128.    }
  129.    m.tree._x = m.tablebig._x + 160;
  130. };
  131. MovieClip.prototype.removeorder = function(id)
  132. {
  133.    r.order.splice(id,1);
  134.    var _loc1_ = id;
  135.    while(_loc1_ < r.order.length)
  136.    {
  137.       if(r.order[_loc1_])
  138.       {
  139.          r.order[_loc1_].id--;
  140.       }
  141.       _loc1_ = _loc1_ + 1;
  142.    }
  143. };
  144. MovieClip.prototype.initnote = function()
  145. {
  146.    var t = this;
  147.    t.xx = t._x;
  148.    t.yy = t._y;
  149.    t._y -= 30;
  150.    t._alpha = 0;
  151.    t.d = 17;
  152.    t.but.enabled = false;
  153.    t.onEnterFrame = function()
  154.    {
  155.       t._y += (t.yy - t._y) / 5;
  156.       t._alpha = Math.min(100,t._alpha + 10);
  157.       t.d--;
  158.       if(!t.d)
  159.       {
  160.          t._y = t.yy;
  161.          t._alpha = 100;
  162.          t.mouseover = 0;
  163.          t.d = r.notetime;
  164.          t.idnow = t.id;
  165.          t.onEnterFrame = function()
  166.          {
  167.             t.xx = r.ox + t.id * r.ospacing;
  168.             t._x += (t.xx - t._x) / 5;
  169.             if(t.zone.hitTest(r._xmouse,r._ymouse,1))
  170.             {
  171.                t.but.enabled = true;
  172.                t.a.hilite();
  173.                t.mouseover = 1;
  174.                popbignote(t.id,t.onumber,t.no,t.from,t.tipe,t.quan);
  175.             }
  176.             else
  177.             {
  178.                t.mouseover = 0;
  179.                t.a.nolite();
  180.             }
  181.             t.d--;
  182.             t.timer.bar._xscale = Math.max(0,Math.min(t.d / r.notetime * 100,100));
  183.             if(!t.d)
  184.             {
  185.                t.onEnterFrame = function()
  186.                {
  187.                   t._alpha -= 10;
  188.                   if(t._alpha <= 0)
  189.                   {
  190.                      if(r.stat.notebig.onumber == t.onumber)
  191.                      {
  192.                         r.stat.notebig.removeMovieClip();
  193.                      }
  194.                      removeorder(t.id);
  195.                      t.removeMovieClip();
  196.                   }
  197.                };
  198.             }
  199.          };
  200.       }
  201.    };
  202.    t.stop();
  203. };
  204. MovieClip.prototype.toCurrency = function(amount)
  205. {
  206.    var _loc1_ = amount % 100;
  207.    if(!_loc1_)
  208.    {
  209.       var _loc3_ = Math.floor(amount / 100) + ".00";
  210.    }
  211.    else
  212.    {
  213.       if(_loc1_ < 10)
  214.       {
  215.          _loc1_ = "0" + _loc1_;
  216.       }
  217.       _loc3_ = Math.floor(amount / 100) + "." + _loc1_;
  218.    }
  219.    return _loc3_;
  220. };
  221. MovieClip.prototype.cekfulfill = function()
  222. {
  223.    var t = this;
  224.    var b = r.stat.notebig;
  225.    if(r.jars[t.no] >= t.sum)
  226.    {
  227.       r.ofulfilled = r.ofulfilled + 1;
  228.       r.jarsold[t.no] += t.sum;
  229.       r.jarsoldtotal += t.sum;
  230.       r.jars[t.no] -= t.sum;
  231.       b.attachMovie("ready","ready",11,{_x:53,_y:145,_rotation:-20 - random(20)});
  232.       var _loc2_ = r.nil * t.sum;
  233.       var _loc7_ = "$" + toCurrency(_loc2_);
  234.       r.stat.attachMovie("money","money" + r.md,r.md,{_x:b._x,_y:b._y + 70,txt:_loc7_});
  235.       r.md = r.md + 1;
  236.       r.ang += _loc2_;
  237.       updatesum();
  238.       r.zcash.start();
  239.       var _loc3_ = 40;
  240.       b._alpha = 100;
  241.       b.d = _loc3_;
  242.       b.onEnterFrame = function()
  243.       {
  244.          b.d--;
  245.          if(b.d < 5)
  246.          {
  247.             b._alpha -= 20;
  248.             if(!b.d)
  249.             {
  250.                b.removeMovieClip();
  251.             }
  252.          }
  253.       };
  254.       t.but.enabled = false;
  255.       t.d = _loc3_;
  256.       t.onEnterFrame = function()
  257.       {
  258.          t._alpha = Math.max(0,t._alpha - 10);
  259.          t._y = t._y + 1;
  260.          t.d--;
  261.          if(!t.d)
  262.          {
  263.             removeorder(t.id);
  264.             t.removeMovieClip();
  265.          }
  266.       };
  267.    }
  268.    else
  269.    {
  270.       r.stat.attachMovie("notenough","notenough",r.nbd + 100,{_x:345,_y:228});
  271.    }
  272. };
  273. MovieClip.prototype.popbignote = function(id, onumber, no, from, tipe, quan)
  274. {
  275.    if(!r.stat.notebig._visible or r.stat.notebig.onumber != onumber)
  276.    {
  277.       var _loc1_ = random(10);
  278.       if(random(100) > 50)
  279.       {
  280.          _loc1_ = - _loc1_;
  281.       }
  282.       r.stat.attachMovie("notebig","notebig",r.nbd,{_x:345,_y:146,_rotation:_loc1_,onumber:onumber,no:no,from:from,tipe:tipe,quan:quan});
  283.    }
  284. };
  285. MovieClip.prototype.makeorder = function()
  286. {
  287.    var _loc7_ = false;
  288.    id = r.order.length;
  289.    var _loc4_ = getrandom("custnames");
  290.    var _loc5_ = getrandom("honeytype");
  291.    var _loc12_ = r.honeynames[_loc5_];
  292.    var _loc8_ = 1 + random(Math.min(3,r.level));
  293.    if(_loc8_ > 1)
  294.    {
  295.       var _loc6_ = _loc8_ + " jars";
  296.    }
  297.    else
  298.    {
  299.       _loc6_ = _loc8_ + " jar";
  300.    }
  301.    var _loc2_ = r.ox + id * ospacing;
  302.    var _loc1_ = random(5);
  303.    if(random(100) > 50)
  304.    {
  305.       _loc1_ = - _loc1_;
  306.    }
  307.    r.stat.attachMovie("notesmall","notesmall" + r.nd,r.nd,{_x:_loc2_,_y:r.oy,_rotation:_loc1_,id:id,onumber:r.onumber,no:_loc5_,from:_loc4_,tipe:_loc12_,quan:_loc6_,sum:_loc8_});
  308.    r.order[id] = r.stat["notesmall" + r.nd];
  309.    r.onumber = r.onumber + 1;
  310.    r.nd = r.nd + 1;
  311. };
  312. MovieClip.prototype.appear = function(speed)
  313. {
  314.    var t = this;
  315.    if(!speed)
  316.    {
  317.       speed = 10;
  318.    }
  319.    t.speed = speed;
  320.    t._alpha = 0;
  321.    t.onEnterFrame = function()
  322.    {
  323.       t._alpha += speed;
  324.       if(t._alpha >= 100)
  325.       {
  326.          t._alpha = 100;
  327.          delete t.onEnterFrame;
  328.       }
  329.    };
  330. };
  331. MovieClip.prototype.disappear = function(speed)
  332. {
  333.    var t = this;
  334.    if(!speed)
  335.    {
  336.       speed = 10;
  337.    }
  338.    t.speed = speed;
  339.    t.onEnterFrame = function()
  340.    {
  341.       t._alpha -= speed;
  342.       if(t._alpha <= 0)
  343.       {
  344.          t._alpha = 0;
  345.          delete t.onEnterFrame;
  346.          t.removeMovieClip();
  347.       }
  348.    };
  349. };
  350. MovieClip.prototype.updatesum = function()
  351. {
  352.    var _loc3_ = "x " + r.jars[1];
  353.    var _loc2_ = "x " + r.jars[2];
  354.    var _loc1_ = "x " + r.jars[3];
  355.    if(r.stat.honey.sum1.txt != _loc3_)
  356.    {
  357.       r.stat.honey.sum1.txt = _loc3_;
  358.       r.stat.honey.box1.gotoAndPlay(2);
  359.    }
  360.    if(r.stat.honey.sum2.txt != _loc2_)
  361.    {
  362.       r.stat.honey.sum2.txt = _loc2_;
  363.       r.stat.honey.box2.gotoAndPlay(2);
  364.    }
  365.    if(r.stat.honey.sum3.txt != _loc1_)
  366.    {
  367.       r.stat.honey.sum3.txt = _loc1_;
  368.       r.stat.honey.box3.gotoAndPlay(2);
  369.    }
  370.    r.stat.cash.txt = "$" + toCurrency(r.ang);
  371.    r.stat.saving.txt = "$" + toCurrency(r.totalang);
  372. };
  373. MovieClip.prototype.initob2 = function(id)
  374. {
  375.    var t = this;
  376.    t.id = id;
  377.    t.onEnterFrame = function()
  378.    {
  379.       if(t.zone.hitTest(r._xmouse,r._ymouse,1))
  380.       {
  381.          t.a.hilite();
  382.       }
  383.       else
  384.       {
  385.          t.a.nolite();
  386.       }
  387.    };
  388.    t.stop();
  389. };
  390. MovieClip.prototype.removeflower = function(it)
  391. {
  392.    it.plant = 0;
  393.    var f = it.place.flowers;
  394.    f.onEnterFrame = function()
  395.    {
  396.       f._alpha -= 5;
  397.       if(f._alpha <= 0)
  398.       {
  399.          f.removeMovieClip();
  400.       }
  401.    };
  402. };
  403. MovieClip.prototype.beestupid = function()
  404. {
  405.    var _loc2_ = this;
  406.    _loc2_.think = [1,1,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0];
  407.    _loc2_.think.randomize();
  408.    _loc2_.thinkno = 0;
  409.    _loc2_.stupid = 1;
  410.    _loc2_.speed = 2 + 0.1 * random(20);
  411. };
  412. MovieClip.prototype.beesmart = function()
  413. {
  414.    var _loc2_ = this;
  415.    _loc2_.think = [1,1,1,1,1,1,1,1,1,1,1,1,1,0,0,0,0,0,0,0,0,0];
  416.    _loc2_.think.randomize();
  417.    _loc2_.thinkno = 0;
  418.    _loc2_.stupid = 0;
  419.    _loc2_.speed = 5 + 0.1 * random(20);
  420. };
  421. MovieClip.prototype.cekfence = function()
  422. {
  423.    var _loc4_ = [];
  424.    var _loc3_ = 0;
  425.    while(_loc3_ < r.fences.length)
  426.    {
  427.       var _loc2_ = r.fences[_loc3_];
  428.       if(_loc2_.plant > 10)
  429.       {
  430.          var _loc1_ = 0;
  431.          while(_loc1_ < r.nests.length)
  432.          {
  433.             if(r.nests[_loc1_].targetflower == _loc2_)
  434.             {
  435.                _loc2_ = undefined;
  436.                break;
  437.             }
  438.             _loc1_ = _loc1_ + 1;
  439.          }
  440.          if(_loc2_ != undefined)
  441.          {
  442.             _loc4_.push(_loc2_);
  443.          }
  444.       }
  445.       _loc3_ = _loc3_ + 1;
  446.    }
  447.    if(_loc4_.length)
  448.    {
  449.       _loc4_.randomize();
  450.       var _loc5_ = _loc4_.pop();
  451.       return _loc5_;
  452.    }
  453.    return false;
  454. };
  455. MovieClip.prototype.cekclick = function()
  456. {
  457.    var _loc2_ = this;
  458.    r.pressed = cekzone();
  459.    if(!r.pressed)
  460.    {
  461.       r.newpos = m._xmouse;
  462.    }
  463.    else
  464.    {
  465.       _loc2_.pmc = r.pressed._parent;
  466.       _loc2_.pid = r.pressed.id;
  467.       if(r.hold == 30 && (_loc2_.pid > 40 && _loc2_.pid <= 43))
  468.       {
  469.          if(_loc2_.pmc.plant > 0 && _loc2_.pmc.plant < 10)
  470.          {
  471.             r.newpos = _loc2_.pmc._x - 40;
  472.          }
  473.          else
  474.          {
  475.             r.newpos = _loc2_.pmc._x;
  476.             _loc2_.pmc = _loc2_.pid = undefined;
  477.             r.pressed = 0;
  478.          }
  479.       }
  480.       else
  481.       {
  482.          r.newpos = _loc2_.pmc._x;
  483.       }
  484.    }
  485. };
  486. MovieClip.prototype.snapshot = function(dest, sourc, x1, y1, wid, hei)
  487. {
  488.    var _loc1_ = new flash.display.BitmapData(wid,hei,true,16777215);
  489.    var _loc2_ = new flash.geom.Matrix();
  490.    _loc2_.translate(- x1,- y1);
  491.    _loc1_.draw(sourc,_loc2_,null,null,new flash.geom.Rectangle(0,0,wid,hei),true);
  492.    dest.attachBitmap(_loc1_,1,"auto",true);
  493. };
  494. MovieClip.prototype.waitandsnap = function(delay)
  495. {
  496.    var t = this;
  497.    t.d = delay;
  498.    t.onEnterFrame = function()
  499.    {
  500.       t.d--;
  501.       if(!t.d)
  502.       {
  503.          t.wid = 190;
  504.          t.hei = 160;
  505.          t.bottombleed = 10;
  506.          t.createEmptyMovieClip("place2",200);
  507.          snapshot(t.place2,t.place,(- t.wid) / 2,- t.hei + t.bottombleed,t.wid,t.hei);
  508.          t.place2._x = (- t.wid) / 2;
  509.          t.place2._y = - t.hei + t.bottombleed;
  510.          t.place.removeMovieClip();
  511.          t.fence.plant += 10;
  512.       }
  513.    };
  514. };
  515. MovieClip.prototype.hilite = function()
  516. {
  517.    var _loc2_ = new flash.filters.GlowFilter(16777215,100,2,2,10,3,false,false);
  518.    this.filters = [_loc2_];
  519. };
  520. MovieClip.prototype.nolite = function()
  521. {
  522.    this.filters = undefined;
  523. };
  524. MovieClip.prototype.initob = function(id)
  525. {
  526.    var t = this;
  527.    t.id = id;
  528.    t.picked = 0;
  529.    t._visible = true;
  530.    t.onEnterFrame = function()
  531.    {
  532.       if(r.hold == t.id)
  533.       {
  534.          if(!t.picked)
  535.          {
  536.             t.picked = 1;
  537.             t._visible = false;
  538.          }
  539.       }
  540.       else if(t.picked)
  541.       {
  542.          t.picked = 0;
  543.          t._alpha = 0;
  544.          t._visible = true;
  545.          t.onEnterFrame = function()
  546.          {
  547.             t._alpha += 10;
  548.             if(t._alpha >= 100)
  549.             {
  550.                t._alpha = 100;
  551.                t.initob(t.id);
  552.             }
  553.          };
  554.       }
  555.       if(t.zone.hitTest(r._xmouse,r._ymouse,1))
  556.       {
  557.          t.a.hilite();
  558.       }
  559.       else
  560.       {
  561.          t.a.nolite();
  562.       }
  563.    };
  564.    t.stop();
  565. };
  566. MovieClip.prototype.cekzone = function()
  567. {
  568.    var _loc1_ = 0;
  569.    while(_loc1_ < r.ob.length)
  570.    {
  571.       if(r.ob[_loc1_].hitTest(r._xmouse,r._ymouse,1))
  572.       {
  573.          return r.ob[_loc1_];
  574.       }
  575.       _loc1_ = _loc1_ + 1;
  576.    }
  577.    return false;
  578. };
  579. MovieClip.prototype.initzone = function()
  580. {
  581.    var _loc2_ = this;
  582.    r.ob.push(_loc2_);
  583.    _loc2_.id = Number(_loc2_._name.substr(2,2));
  584.    _loc2_._parent.zone = _loc2_;
  585.    _loc2_._visible = false;
  586. };
  587. MovieClip.prototype.energize = function(a)
  588. {
  589.    r.energy = Math.min(r.energymax,r.energy + a);
  590.    r.energy = Math.max(0,r.energy);
  591.    if(a > 0)
  592.    {
  593.       r.zbonus.start();
  594.    }
  595.    else
  596.    {
  597.       r.zhit.start();
  598.    }
  599.    r.energybar.gotoAndPlay(1);
  600. };
  601. MovieClip.prototype.initpopup = function(delay, distance, golabel)
  602. {
  603.    var t = this;
  604.    if(!delay)
  605.    {
  606.       delay = 30;
  607.    }
  608.    if(!distance)
  609.    {
  610.       distance = 20;
  611.    }
  612.    t.yy = t._y - distance;
  613.    t._alpha = 0;
  614.    var d = delay;
  615.    t.onEnterFrame = function()
  616.    {
  617.       t._alpha = Math.min(100,t._alpha + 20);
  618.       t._y = Math.floor(t._y + (t.yy - t._y) / 3);
  619.       d--;
  620.       if(!d)
  621.       {
  622.          t.onEnterFrame = function()
  623.          {
  624.             t._alpha -= 20;
  625.             t._y -= 3;
  626.             if(t._alpha <= 0)
  627.             {
  628.                delete t.onEnterFrame;
  629.                if(!golabel)
  630.                {
  631.                   t.removeMovieClip();
  632.                }
  633.                else
  634.                {
  635.                   t.gotoAndPlay(golabel);
  636.                }
  637.             }
  638.          };
  639.       }
  640.    };
  641.    t.stop();
  642. };
  643. MovieClip.prototype.jiggle = function(beginska)
  644. {
  645.    var t = this;
  646.    if(!beginska)
  647.    {
  648.       beginska = 150;
  649.    }
  650.    t._xscale = t._yscale = beginska;
  651.    t.ska = 100;
  652.    t.dx = 0;
  653.    t.dy = 0;
  654.    t.dv = 0.8;
  655.    t.dvstep = 0.6;
  656.    t.onEnterFrame = function()
  657.    {
  658.       t.dx = t.dx * t.dvstep + (t.ska - t._xscale) * t.dv;
  659.       t._xscale += t.dx;
  660.       t._yscale = t._xscale;
  661.    };
  662. };
  663. Array.prototype.count = function(val)
  664. {
  665.    var _loc3_ = 0;
  666.    var _loc2_ = 0;
  667.    while(_loc2_ < this.length)
  668.    {
  669.       if(this[_loc2_] == val)
  670.       {
  671.          _loc3_ = _loc3_ + 1;
  672.       }
  673.       _loc2_ = _loc2_ + 1;
  674.    }
  675.    return _loc3_;
  676. };
  677. Array.prototype.contain = function(val)
  678. {
  679.    var _loc3_ = false;
  680.    var _loc2_ = 0;
  681.    _loc2_ = 0;
  682.    while(_loc2_ < this.length)
  683.    {
  684.       if(this[_loc2_] == val)
  685.       {
  686.          _loc3_ = _loc3_ + 1;
  687.       }
  688.       _loc2_ = _loc2_ + 1;
  689.    }
  690.    return _loc3_;
  691. };
  692. Array.prototype.removeElement = function(i)
  693. {
  694.    if(i == null)
  695.    {
  696.       i = 0;
  697.    }
  698.    var _loc4_ = this[i];
  699.    var _loc2_ = i;
  700.    while(_loc2_ < this.length - 1)
  701.    {
  702.       this[_loc2_] = this[_loc2_ + 1];
  703.       _loc2_ = _loc2_ + 1;
  704.    }
  705.    this.pop();
  706.    return _loc4_;
  707. };
  708. Array.prototype.removeValue = function(a)
  709. {
  710.    var _loc2_ = 0;
  711.    while(_loc2_ < this.length)
  712.    {
  713.       if(a == this[_loc2_])
  714.       {
  715.          this.removeElement(_loc2_);
  716.       }
  717.       _loc2_ = _loc2_ + 1;
  718.    }
  719. };
  720. Array.prototype.randomize = function()
  721. {
  722.    return this.sort(function(a, b)
  723.    {
  724.       return Math.floor(Math.random() * 2) != 0 ? -1 : 1;
  725.    }
  726.    );
  727. };
  728. Array.prototype.copy = Array.prototype.slice;
  729. Object.prototype.clone = function()
  730. {
  731.    if(this instanceof Array)
  732.    {
  733.       var _loc2_ = [];
  734.       var _loc3_ = 0;
  735.       while(_loc3_ < this.length)
  736.       {
  737.          _loc2_[_loc3_] = typeof this[_loc3_] != "object" ? this[_loc3_] : this[_loc3_].clone();
  738.          _loc3_ = _loc3_ + 1;
  739.       }
  740.    }
  741.    else if(this instanceof XML || this instanceof MovieClip)
  742.    {
  743.       _loc2_ = null;
  744.       trace("Warning! Object.clone can not be used on MovieClip or XML objects");
  745.    }
  746.    else
  747.    {
  748.       _loc2_ = {};
  749.       for(_loc3_ in this)
  750.       {
  751.          _loc2_[_loc3_] = typeof this[_loc3_] != "object" ? this[_loc3_] : this[_loc3_].clone();
  752.       }
  753.    }
  754.    return _loc2_;
  755. };
  756. ASSetPropFlags(Object.prototype,["clone"],1);
  757. MovieClip.prototype.fadescreen = function(speed)
  758. {
  759.    if(!speed)
  760.    {
  761.       speed = 5;
  762.    }
  763.    r.createEmptyMovieClip("dark",100001);
  764.    var d = r.dark;
  765.    d.speed = speed;
  766.    d.lineStyle(1,0,100);
  767.    d.beginFill(16777215,100);
  768.    d.moveTo(-5000,-5000);
  769.    d.lineTo(5000,-5000);
  770.    d.lineTo(5000,5000);
  771.    d.lineTo(-5000,5000);
  772.    d.endFill();
  773.    d.onEnterFrame = function()
  774.    {
  775.       d._alpha -= d.speed;
  776.       if(d._alpha <= 0)
  777.       {
  778.          d.removeMovieClip();
  779.          d.stop();
  780.       }
  781.    };
  782. };
  783. MovieClip.prototype.getrandom = function(aray)
  784. {
  785.    if(r.randomlisting.length > 0)
  786.    {
  787.       var _loc3_ = 0;
  788.       var _loc1_ = 0;
  789.       while(_loc1_ < r.randomlisting.length)
  790.       {
  791.          if(r.randomlisting[_loc1_] == aray)
  792.          {
  793.             _loc3_ = 1;
  794.             break;
  795.          }
  796.          _loc1_ = _loc1_ + 1;
  797.       }
  798.       if(!_loc3_)
  799.       {
  800.          r.randomlisting.push(aray);
  801.       }
  802.    }
  803.    else
  804.    {
  805.       r.randomlisting = [];
  806.       r.randomlisting.push(aray);
  807.    }
  808.    if(r[aray + "getrandom"].length <= 0)
  809.    {
  810.       r[aray + "getrandom"] = [];
  811.       r[aray + "getrandom"] = r[aray].clone();
  812.       r[aray + "getrandom"].randomize();
  813.       if(r[aray + "getrandom"].length > 1)
  814.       {
  815.          if(r[aray + "lastpop"] == r[aray + "getrandom"][r[aray + "getrandom"].length - 1])
  816.          {
  817.             r[aray + "getrandom"].pop();
  818.          }
  819.       }
  820.    }
  821.    var _loc4_ = r[aray + "getrandom"].pop();
  822.    r[aray + "lastpop"] = _loc4_;
  823.    return _loc4_;
  824. };
  825. MovieClip.prototype.resetrandom = function()
  826. {
  827.    if(r.randomlisting.length > 0)
  828.    {
  829.       var _loc1_ = 0;
  830.       while(_loc1_ < r.randomlisting.length)
  831.       {
  832.          r[r.randomlisting[_loc1_] + "getrandom"] = [];
  833.          r[r.randomlisting[_loc1_] + "lastpop"] = undefined;
  834.          _loc1_ = _loc1_ + 1;
  835.       }
  836.    }
  837. };
  838. MovieClip.prototype.findang = function(dx, dy)
  839. {
  840.    return deg(Math.atan2(dy,dx));
  841. };
  842. MovieClip.prototype.rad = function(qdeg)
  843. {
  844.    return qdeg * 0.017453292519943295;
  845. };
  846. MovieClip.prototype.deg = function(qrad)
  847. {
  848.    return qrad * 57.29577951308232;
  849. };
  850. Color.prototype.setBrightness = function(value)
  851. {
  852.    this.setTransform({ra:100,rb:0,ga:100,gb:0,ba:100,bb:0});
  853.    var trans = this.getTransform();
  854.    var percent = Math.abs(value) / 100;
  855.    var brightnessColor = value <= 0 ? 0 : 255;
  856.    with(trans)
  857.    {
  858.       ra -= ra * percent;
  859.       ga -= ga * percent;
  860.       ba -= ba * percent;
  861.       rb += (brightnessColor - rb) * percent;
  862.       gb += (brightnessColor - gb) * percent;
  863.       bb += (brightnessColor - bb) * percent;
  864.    }
  865.    this.setTransform(trans);
  866. };
  867. Color.prototype.resetColor = function()
  868. {
  869.    this.setTransform({ra:100,rb:0,ga:100,gb:0,ba:100,bb:0});
  870. };
  871. Sound.prototype.fade = function(fadeType, fadeDuration)
  872. {
  873.    this.fadeDuration = fadeDuration * 1000 / 100;
  874.    this.fadeType = fadeType;
  875.    this.currentVolume = this.getVolume();
  876.    this.intID = setInterval(function(thisObj)
  877.    {
  878.       thisObj.doFade(thisObj.fadeType);
  879.    }
  880.    ,this.fadeDuration,this);
  881.    this.doFade = function(fadeType)
  882.    {
  883.       if(fadeType == "out")
  884.       {
  885.          this.setVolume(this.currentVolume--);
  886.          if(this.getVolume() <= 0)
  887.          {
  888.             clearInterval(this.intID);
  889.          }
  890.       }
  891.       else if(fadeType == "in")
  892.       {
  893.          this.setVolume(this.currentVolume++);
  894.          if(this.getVolume() >= 100)
  895.          {
  896.             clearInterval(this.intID);
  897.          }
  898.       }
  899.    };
  900. };
  901. MovieClip.prototype.wait = function(delay)
  902. {
  903.    this.createEmptyMovieClip("wdl",55555);
  904.    this.wdl.delay = delay;
  905.    this.wdl.onenterframe = function()
  906.    {
  907.       this.delay = this.delay - 1;
  908.       if(!this.delay)
  909.       {
  910.          delete this.onenterframe;
  911.          this._parent.play();
  912.          this.removeMovieClip();
  913.       }
  914.    };
  915.    this.stop();
  916. };
  917. MovieClip.prototype.savecookie = function(vari, value)
  918. {
  919.    var _loc1_ = SharedObject.getLocal("lazcookie","/");
  920.    _loc1_.data[vari] = value;
  921.    _loc1_.flush();
  922. };
  923. MovieClip.prototype.loadcookie = function(vari)
  924. {
  925.    var _loc1_ = SharedObject.getLocal("lazcookie","/");
  926.    if(_loc1_.data[vari] != null)
  927.    {
  928.       return _loc1_.data[vari];
  929.    }
  930.    return false;
  931. };
  932.